import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'model/car.dart';
import 'model/home.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() {
  // runApp(const MyApp());
  // runApp(const Center(
  //   child: Text(
  //     'helloFlutter2',
  //     textDirection: TextDirection.ltr,
  //   ),
  // ));
  // 中国
  // 你好
  runApp(App());
}

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    // ScreenUtil.init(context, designSize: const Size(1170, 2532));
    return ScreenUtilInit(
      designSize: const Size(1170, 2532),//  iphone6 750 1334       iphone 12 mini 1080 2340
      minTextAdapt: true,
      splitScreenMode: true,
      builder: (_ , child) {
        return
          MaterialApp(
            localizationsDelegates: const [
              GlobalMaterialLocalizations.delegate,
              GlobalWidgetsLocalizations.delegate,
            ],
            supportedLocales: const [
              Locale('zh', 'CH'),
              Locale('en', 'US'),
            ],
            // locale: const Locale('zh'),
            debugShowCheckedModeBanner: false,
            theme: ThemeData(
              primarySwatch: Colors.lightBlue,
              highlightColor: const Color.fromRGBO(0, 0, 0, 0),
              splashColor: const Color.fromRGBO(0, 0, 0, 0),
            ),
            // home: ,
            home: const Home(),
          );
      },
    );
  }
}

